<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./css/font-awesome.min.css">
    <link rel="stylesheet" href="./js/jquery-weui-build/lib/weui.min.css">
    <link rel="stylesheet" href="./js/jquery-weui-build/css/jquery-weui.min.css">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/doctor.css">
    <script src="./js/jquery-weui-build/lib/jquery-2.1.4.js"></script>
    <script src="./js/jquery-weui-build/js/jquery-weui.min.js"></script>
    <script src="./js/common.js"></script>
    <title>医生登录</title>
    <style>
        body {
            background: url("./images/bg1.jpg") center 0 no-repeat;
            background-size: cover;
            background-attachment: fixed;
        }

        body:before {
            background: url("./images/bg1.jpg") center 0 no-repeat;
            background-size: cover;
        }
    </style>
</head>

<body>
    <header class="header">
        <div class="title">
            <h1 class="f14">医生登录</h1>
        </div>
    </header>
    <section class="content">
        <section class="logo_t">
            <!-- <div class="logo w">
                <div class="logo_img">
                    <img src="./images/logo.png" alt="">
                </div>
                <div class="log_title">
                     <p>子宫内膜异位症患者</p> 
                     <p>院外关爱</p> 
                     <p>主办方：中华国际医学交流基金会</p>
                </div>
            </div> -->
        </section>
        <form class="login" id="formLogin">
            <div class="username">
                <span class="add-on"><i class="icon-user"></i></span>
                <input type="text" name="username" placeholder="请输入用户名">
            </div>
            <div class="password">
                <span class="add-on"><i class="icon-lock"></i></span>
                <input type="password" name="password" placeholder="请输入密码">
            </div>
        </form>
        <div class="login_btn">
            <button id="login_form" class="f12">登&nbsp;录</button>
        </div>
        <div class="forgot_password">
            <a class="" href="#">忘记密码？</a>
        </div>
    </section>
    <div class="bg_model none"></div>
    <div class="modal_content none login_modal_content"></div>
    <div class="weui-loadmore none">
        <i class="weui-loading"></i>
        <span class="weui-loadmore__tips">正在加载</span>
    </div>
    <script>
        $(function () {
            $('#login_form').click(function () {
                var username = $('input[name=username]').val();
                var password = $('input[name=password]').val();
                if (username == '' || username == null) {
                    $('.bg_model').fadeIn();
                    $('.modal_content').fadeIn().text('请输入用户名');
                    timer();
                } else if (password == '' || username == null) {
                    $('.bg_model').fadeIn();
                    $('.modal_content').fadeIn().text('请输入密码');
                    timer();
                } else {
                    console.log($('#formLogin').serialize())
                    $.ajax({
                        url: '',
                        type: 'post',
                        data: $('#formLogin').serialize(),
                        beforeSend: function () {
                            $('.weui-loadmore').show();
                            $('.bg_model').show();
                        },
                        success: function (data) {
                            if (data.type == "success") {
                                $('.weui-loadmore').hide();
                                $('.bg_model').hide();
                                window.location.href = './index';
                            } else {
                                // $('.bg_model').fadeIn();
                                // $('.modal_content').fadeIn().text(data.message);
                                // timer();
                            }
                        }
                    })
                }

            })
        })
    </script>
</body>

</html>